const app = getApp()
const api = require('../../config/api.js')

Page({
  data: {
  
  },
  
  getUserInfo:function(){
    let userInfo = {}
    if (app.globalData.xuserInfo) {
      userInfo = Object.assign(app.globalData.userInfo,app.globalData.xuserInfo)
    } else {
      userInfo = app.globalData.userInfo
    }
    return userInfo
  },

  onLoad() {
    this.setData({
      iLikesNum:app.globalData.iLikesNum,
      likeMeNum:app.globalData.likeMeNum,
      userInfo:this.getUserInfo(),
    })
  },
  onShow(){
    this.setData({
      iLikesNum:app.globalData.iLikesNum,
      likeMeNum:app.globalData.likeMeNum,
      userInfo:this.getUserInfo(),
    })
  },

  
  toprofile:function(){
    qq.navigateTo({
      url: '/pages/mine/profile/profile'　　
    })
  },
  toILike:function(){
    qq.navigateTo({
      url: '/pages/mine/ILike/ILike'　　
    })
  },
  toLikeMe:function(){
    qq.navigateTo({
      url: '/pages/mine/likeMe/likeMe'　　
    })
  },
  toVisitors:function(){
    qq.navigateTo({
      url: '/pages/mine/visitor/visitor'　
    })
  },
  toSetting:function(){
    qq.openSetting({
      success(res) {
        console.log(res.authSetting)
        // res.authSetting = {
        //   "scope.userInfo": true,
        //   "scope.userLocation": true
        // }
      }
    })
  }
})